//
//  TCM_InformationDetailsViewController.swift
//  TCM_TradingProject
//
//  Created by 吕春海 on 2018/8/28.
//  Copyright © 2018年 lvchunhai. All rights reserved.
//

import UIKit

class TCM_InformationDetailsViewController: TCM_BaseViewController {
    let layout = KLCPopupLayout.init(horizontal: .center, vertical: .bottom)
    var pop:KLCPopup = KLCPopup()
    let shareView:TCM_ShareView = Bundle.main.loadNibNamed("TCM_ShareView", owner: nil, options: nil)?.first as! TCM_ShareView
    override func viewDidLoad() {
        super.viewDidLoad()
        self.title = "资讯详情"
        // Do any additional setup after loading the view.
        navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "TCM_InformationShare"), style: .plain, target: self, action: #selector(shareButtonClick))
        shareView.frame = CGRect(x: 0, y: 0, width: TCM_ScreenWidth, height: 133)
        pop = KLCPopup(contentView:shareView, showType: KLCPopupShowType.slideInFromBottom, dismissType: KLCPopupDismissType.slideOutToBottom, maskType: KLCPopupMaskType.dimmed, dismissOnBackgroundTouch: true, dismissOnContentTouch: false)
        shareView.cancelClouser = {
            self.pop.dismiss(true)
        }
        shareView.title = "测试"
        shareView.descr = "test"
        shareView.webpageUrl = "www.baidu.com"
        shareView.thumbImage = UIImage.init(named: "userHead")
//        self?.img.kf.setImage(with: URL(string:model.coverUrl ?? ""), placeholder: nil, options: nil, progressBlock: nil, completionHandler: { (image, error, cache, url) in
//            self?.shareView.thumbImage = image
//        })
    }

    @objc func shareButtonClick() {
        pop.show(with: layout)
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
